<? echo $adminMenu->write(); ?>

<div id="preview" style="display: none;"></div>

<? echo $form->create(); ?>
<fieldset><legend><? __('New news'); ?></legend>
    <ul>
        <li><? echo $form->input('News.title',array('label'=>__('Title',true),'div'=>false)); ?></li>
        <li><? echo $form->input('News.seo_link',array('label'=>__('Seo link',true),'div'=>false)); ?></li>
        <li><? echo $form->input('News.text',array('rows'=> 10, 'cols'=>50,'type'=>'textarea')); ?></li>
        <li><? echo $form->label('created',__('Date',true)); echo $form->dateTime('created','DMY',24,time()); ?></li>
        <li><? echo $form->input('News.user_id',array('label'=>__('Author',true),'div'=>false)); ?></li>
    </ul>
</fieldset>
<div class="input_line">
    <button onclick="new Ajax.Updater('preview', '<? echo $html -> url(array('controller'=>'news','action'=>'preview')); ?>',  {asynchronous:true, evalScripts:true, parameters:Form.serialize('NewsAddForm'),onLoading:function(request){Element.show('news_loading')} ,onComplete:function(request){Element.hide('news_loading');Element.show('preview')}}); return false;"><? __('preview') ?></button>
    <? echo $form->submit(__('publish',true),array("div"=>false)); ?>
    <span id="news_loading" style="display: none;"><? echo $html -> image("spinner.gif",array('alt'=>"Spinner"));?></span>
</div>
</form>
